/**
 * 
 */
package wayic.http;

import java.io.IOException;

import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;

/**
 * This wraps over Apache HttpClient and provides convenient customization  methods to the application.
 * @author Ashesh Nishant
 *
 */
public interface HttpLoader {
	
	/**
	 * The User-Agent string to be used in User-Agent:xxxx request header. 
	 * @return
	 */
	public String getUserAgent();
	
	/**
	 * Timeout in ms for connection to get established with host.
	 * @return
	 */
	public int getConnectionTimeout();
	
	/**
	 * Timeout for waiting for getting a connection from manager.
	 * @return
	 */
	public int getConnectionManagerTimeout();
	
	/**
	 * Socket timeout in ms - timeout for waiting for data.
	 * @return
	 */
	public int getSocketTimeout();

	/**
	 * Max number of active connections.
	 * @return
	 */
	public int getMaxTotalConnections();
	
	/**
	 * Number of redirects allowed.
	 * @return
	 */
	public int getMaxRedirects();
	
	/**
	 * Number of retries in case of Transport failure
	 * 
	 * @return
	 */
	public int getRetryCount();
	
	/**
	 * @return. The response code of the method.
	 * @throws IOException
	 * @throws HttpException
	 */
	public int execute(GetMethod get) throws IOException, HttpException;

}
